package com.qingcloud.adminbackend.enums;

public enum MessageConfigEnum {

    WECHAT("wechat", "微信公众号"),
    MAIL("mail", "电子邮件"),
    SMS("sms", "短信"),
    PLATFORM("platform", "PC平台");

    public String type;

    public String name;

    MessageConfigEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(String type) {
        MessageConfigEnum[] uss = values();
        for (MessageConfigEnum us : uss) {
            if (us.type.equalsIgnoreCase(type) ) {
                return us.name;
            }
        }
        return null;
    }
}
